package com.ruoyi.web.controller.storage;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.storage.domain.RepoKc;
import com.ruoyi.storage.domain.RepoWare;
import com.ruoyi.storage.service.RepoKcService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/storage/kc")
public class KCManageController extends BaseController {

    @Autowired
    private RepoKcService repoKcService;

    private String perfix = "/storage/kc";

    @RequiresPermissions("storage:kc:view")
    @RequestMapping()
    public String index(){
        return perfix + "/kc_index";
    }

    /**
     * 查看库存列表
     * @return
     */
    @RequiresPermissions("storage:ware:list")
    @RequestMapping("/list")
    @ResponseBody
    public TableDataInfo list(RepoKc repoKc)
    {
        startPage();
        List<RepoKc> list = repoKcService.selectAllRepoKcs(repoKc);
        return getDataTable(list);
    }
}
